16 vector
< vector
<int> > w
;
17 for (int i
=0; i
<C
; ++i
){
21 for (int j
=0; j
<K
; ++j
){
28 memset(dp
, 0, sizeof dp
);
30 for (int j
=0; j
<w
[0].size(); ++j
){
31 dp
[w
[0][j
]][0] = true; //Primer nivel
34 for (int i
=1; i
<C
; ++i
){
35 for (int t
=0; t
<=T
; ++t
){
36 for (int j
=0; j
<w
[i
].size(); ++j
){
37 if (t
- w
[i
][j
] >= 0){
38 if (dp
[t
-w
[i
][j
]][i
-1]){
47 for (int t
=T
; t
>=0; --t
){
56 cout
<< "no solution" << endl
;